package com.yupi.springbootinit.strategy;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yupi.springbootinit.datasource.DataSource;
import lombok.Data;

/**
 * @author LZH
 * @date 2023/6/13
 */
@Data
public class SearchContext {
    private DataSource dataSource;
    private String searchText;
    private Long pageNum;
    private Long pageSize;

    public SearchContext(DataSource dataSource) {
        this.dataSource = dataSource;
    }

    public Page search() {
        return dataSource.doSearch(searchText, pageNum, pageSize);
    }
}